/**
 * @description 加密相关
 * @author 盘古他爹
 */
import * as bcrypt from "bcryptjs"
class _Bcrypt {
    hashStr(str: string) {
        const salt = bcrypt.genSaltSync(10);
        return bcrypt.hashSync(str, salt)
    }

    compareHash(str: string, hash: string) {
        return bcrypt.compareSync(str, hash)
    }
}

// module.exports = {
//     Bcrypt: new Bcrypt()
// }

const Bcrypt = new _Bcrypt()

export {
    Bcrypt
}
